<html>
<head><meta charset="utf-8"><title>method resolution quirk · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html">method resolution quirk</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216886909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216886909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jplatte <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216886909">(Nov 16 2020 at 15:32)</a>:</h4>
<p>Hi! Not sure if this is the right place (there doesn't seem to be a stream for the 2021 edition) but I've opened an issue¹ a while ago about surprising method resolution in a corner case that then got tagged and somebody gave it a thumbs up, then nothing else having happened. </p>
<p>Now this seems like the kind of thing that would only be fixed as part of an edition if at all, so that's why I'm here, to get some more eyes on this and figure out whether it could be fixed with next year's edition.</p>
<p>¹ <a href="https://github.com/rust-lang/rust/issues/68826">https://github.com/rust-lang/rust/issues/68826</a></p>



<a name="216887419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216887419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216887419">(Nov 16 2020 at 15:36)</a>:</h4>
<p>Going to move this over to <a class="stream" data-stream-id="213817" href="/#narrow/stream/213817-t-lang">#t-lang</a> which will ultimately make the call here, but I don't expect this to change personally.</p>



<a name="216887470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216887470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216887470">(Nov 16 2020 at 15:36)</a>:</h4>
<p>This topic was moved here from <a class="stream-topic" data-stream-id="241545" href="/#narrow/stream/241545-t-release/topic/edition.202021">#t-release &gt; edition 2021</a> by <span class="user-mention silent" data-user-id="116122">simulacrum</span></p>



<a name="216887587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216887587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216887587">(Nov 16 2020 at 15:37)</a>:</h4>
<p>I think there's likely code out there relying on the current behavior and though we could transition without too much trouble (I'd even be in favor) doing that legwork in time for 2021 edition seems unlikely to me</p>



<a name="216888291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216888291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216888291">(Nov 16 2020 at 15:42)</a>:</h4>
<p>the issue here is that we first look for impls taking <code>Struct</code> and then <code>&amp;Struct</code> <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> see <a href="https://github.com/rust-lang/rust/issues/75243#issuecomment-683473127">https://github.com/rust-lang/rust/issues/75243#issuecomment-683473127</a> which has pretty much the same underlying issue</p>



<a name="216888659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216888659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216888659">(Nov 16 2020 at 15:45)</a>:</h4>
<p>i am generally in favor of changing this but it might be a decent amount of work to do so without breaking a lot of existing code or worsening perf</p>



<a name="216907792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216907792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jplatte <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216907792">(Nov 16 2020 at 17:59)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span>  Is the 2021 edition planned to be earlier in the year than the 2018 edition? Or do you just expect this to be a huge amount of work?</p>



<a name="216907935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216907935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216907935">(Nov 16 2020 at 18:00)</a>:</h4>
<p>Large amount of work and in an area where we don't have a lot of experts.</p>



<a name="216919423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/216919423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#216919423">(Nov 16 2020 at 19:28)</a>:</h4>
<p><span class="user-mention" data-user-id="198047">@jplatte</span> One of the goals for the 2021 edition was that all the changes for it should be "feature complete" in 2020 to avoid the crunch we had for 2018.  (So just polishing and bug fixing in 2021 before shipping it.)</p>



<a name="217145084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/method%20resolution%20quirk/near/217145084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/method.20resolution.20quirk.html#217145084">(Nov 18 2020 at 14:58)</a>:</h4>
<p>I went ahead and closed the issue -- as I wrote there, I think the right way forward would be a project proposal, but I'd personally be reluctant to take this work on right now.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>